import { request } from '@/plugins/request'

interface UserData{
    username?: string,
    email: string,
    password: string
}
interface SignData {
    user:UserData
}

export const login = (data:SignData) => {
  return request({
    method: 'POST',
    url: '/api/users/login',
    data
  })
}

export const register = (data:SignData) => {
  return request({
    method: 'POST',
    url: '/api/users',
    data
  })
}
